package com.zgiot.sf.sfmonitorTools.listener;

import com.zgiot.sf.common.dataprocessor.DataListener;
import com.zgiot.sf.common.pojo.DataChangeEvent;
import com.zgiot.sf.common.pojo.DataModel;
import com.zgiot.sf.common.pojo.WatchedSeries;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

@Component
public class SfmonitorToolsListener implements DataListener {
    private static final Logger logger = LoggerFactory.getLogger(SfmonitorToolsListener.class);

//    @Value("${wd.pcs.filterpress.listener}")
//    private String enable;
    @Value("${global.corpId}")
    private String corpId;


    @Override
    public Object onErrorData(DataChangeEvent event) {
        return DataListener.super.onErrorData(event);
    }

    @Override
    public Object onDataChange(DataChangeEvent event) {
        logger.debug("[历史记录-操作监听]change dm：{}",event.getDataModel());

      return null;
    }

    @Override
    public Object onError(Throwable error) {
        return null;
    }

    @Override
    public WatchedSeries getWatchedSeries() {
        WatchedSeries watchedSeries = new WatchedSeries();
        DataModel dataModel = new DataModel();
        List<DataModel> dataModelList = new ArrayList<>();
        dataModel.setValue(null);
        dataModelList.add(dataModel);
        watchedSeries.setDataModels(dataModelList);
        return watchedSeries;
    }

    @Override
    public boolean isEnabled() {
        return Boolean.valueOf(false);
    }

    @Override
    public int getPriority() {
        return 0;
    }
}
